/** * llmindex.io — per-domain leaderboard with sub-metrics (live-updating) * Author: Simon-Pierre Boucher * Contact: contact@spboucher.ai * License: Proprietary — © Simon-Pierre Boucher, all rights reserved */ import Link from 'next/link'; import { notFound } from 'next/navigation'; import { DOMAINS, INDEX_VERSION, isDomain } from '@llmindex/scoring'; import { LiveLeaderboard, type ApiEntry, type ApiRun } from '@/components/LiveLeaderboard'; import { getLeaderboard } from '@/lib/data'; export const revalidate = 300; export function generateStaticParams() { return DOMAINS.map((domain) => ({ domain })); } export default async function DomainLeaderboardPage({ params }: { params: { domain: string } }) { if (!isDomain(params.domain)) notFound(); const data = await getLeaderboard(params.domain); const title = params.domain.replaceAll('_', ' '); const initialRun: ApiRun | null = data ? { id: data.run.id, kind: data.run.kind, status: data.run.status, created_at: new Date(data.run.createdAt).toISOString(), notes: data.run.notes, } : null; const initialEntries: ApiEntry[] = (data?.entries ?? []).map((e) => ({ rank: e.rank, model: e.slug, name: e.name, provider: e.provider, score: e.score, score_low: e.scoreLow, score_high: e.scoreHigh, sub_metrics: e.subMetrics, })); return (
← Global

{title}

); }